from flask import Flask, jsonify
app = Flask(__name__)

#CICD Test
@app.route('/deploy', methods=['POST'])
def deploy_service():
    # 调用Docker部署逻辑
    subprocess.call(['docker', 'build', '-t', 'myapp', '.'])
    subprocess.call(['docker', 'run', '-d', '--name', 'myapp', 'myapp'])
    #
    return jsonify({"status": "success"})

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000)